package com.wx.oss.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @BelongsProject: xx-club
 * @BelongsPackage: com.wx.oss.config
 * @Author: wangx
 * @CreateTime: 2024-03-18  10:07
 * Minio配置类
 * @Version: 1.0
 */
@Configuration
public class MinioConfig {

    // 这里配置minio的连接信息
    //url
   @Value("${minio.url}")
    private String url;
   //账户
    @Value("${minio.accessKey}")
     private String accessKey;
    //密码
     @Value("${minio.secretKey}")
     private String secretKey;

    /**
     * 构造minio客户端
     */
    @Bean
    public MinioClient getMinioClient(){
        return MinioClient.builder().endpoint(url).credentials(accessKey,secretKey).build();
    }
}


